﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using 绩效管理系统;
using 绩效管理系统.Common;

namespace 绩效管理系统
{
    public partial class FormMain : Form
    {
        //FormUserManager formUserManager;
        //FrmBaseManager frmBaseManager;

        public FormMain()
        {
            InitializeComponent();
        }

        private void FormMain_Load(object sender, EventArgs e)
        {
            Form form =FormFactory.CreateForm("FormUserManager");
            //Sqlhelper.ConStr = ConfigurationManager.ConnectionStrings["ConStr"].ConnectionString;
            /*FormUserManager formUserManager = new FormUserManager();
            formUserManager.MdiParent = this;
            formUserManager.Parent = splitContainer1.Panel2;
            formUserManager.Show();*/
            //Form form = FormFactory.CreateForm(0);
            form.MdiParent = this;
            form.Parent = splitContainer1.Panel2;
            form.Show();
        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            foreach (TreeNode node in trvMenu.Nodes)
            {
                node.BackColor = Color.White;
                node.ForeColor = Color.Black;
            }
            e.Node.BackColor = SystemColors.Highlight;
            e.Node.ForeColor = Color.White;
            Form form  = FormFactory.CreateForm(e.Node.Tag?.ToString());
            form.MdiParent = this;
            form.Parent = splitContainer1.Panel2;
            form.Show();
        }
    }
}
